package com.xxx.client.android.api;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ArticleListEntry implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4107270128882073075L;
	private Integer headerId;
	private String header;
	private List<ArticleVO> articleList;

	public Integer getHeaderId() {
		return headerId;
	}

	public List<ArticleVO> getArticleList() {
		return articleList;
	}

	public ArticleListEntry() {
		articleList = new ArrayList<ArticleVO>();
	}

	public ArticleListEntry(int size) {
		articleList = new ArrayList<ArticleVO>(size);
	}

	public String getHeader() {
		return header;
	}

	public void setHeader(String header) {
		this.header = header;
	}

	public int getCount() {
		if (articleList != null) {
			return articleList.size();
		} else {
			return 0;
		}
	}

	public ArticleVO getArticle(int index) {
		return articleList.get(index);
	}

	public void addArticle(ArticleVO articleVO) {
		articleList.add(articleVO);
		if (headerId == null) {
			this.headerId = articleVO.getSubMenuId();
		}
	}
}
